// OpenGLCase.cpp: 定义控制台应用程序的入口点。
//

#include <iostream>
#include <stdlib.h>

#include "OpenGLCase0.h"
#include "OpenGLCase1.h"
#include "OpenGLCase2.h"
#include "OpenGLCase3.h"
#include "OpenGLCase4.h"
#include "OpenGLCase5.h"
#include "OpenGLCase6.h"
#include "OpenGLCase7.h"

using namespace std;

bool doAction(char operate) {
	switch (operate)
	{
		case '0':
			runCase0();
			return true;
		case '1':
			runCase1();
			return true;
		case '2':
			runCase2();
			return true;
		case '3':
			runCase3();
			return true;
		case '4':
			runCase4();
			return true;
		case '5':
			runCase5();
			return true;
		case '6':
			runCase6();
			return true;
		case '7':
			runCase7();
			return true;
		case 'c':
		case 'C':
			system("cls");
			return true;
		case 'q':
		case 'Q':
			return false;
		default:
			return true;
	}
}

int main()
{
	cout << "hello opengl" << endl;

	char operate;
	
	do {
		cout << "請輸入編號查看制定案例,退出请输入 Q 键,清屏请输入 C" << endl;
		cout << "0.初识案例" << endl;
		cout << "1.繪製三角" << endl;
		cout << "2.数值微分法绘制直线（DDA算法）" << endl;
		cout << "3.Bresenham算法绘制直线" << endl;
		cout << "4.八分法绘制圆形" << endl;
		cout << "5.中点法绘制圆形" << endl;
		cout << "6.中点法绘制椭圆形" << endl;
		cout << "7.X扫描线算法绘制多边形" << endl;
		cin >> operate;
	} while (doAction(operate));
	system("pause"); 
	return 0;
}